package netty.protocoltcp;

import io.netty.channel.ChannelInitializer;
import io.netty.channel.socket.SocketChannel;

/**
 * Created by yu756 on 2020/1/9 16:14
 */
public class MyClientInitializer extends ChannelInitializer<SocketChannel> {
    @Override
    protected void initChannel(SocketChannel socketChannel) throws Exception {
        socketChannel.pipeline().addLast(new MyMessageEncoder()) // 加入编码器
                .addLast(new MyMessageDecoder())
                .addLast(new MyClientHandler());

    }
}
